<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.homepage.*" %>
<%


	String job_type		= StringUtil.nvl(request.getParameter("job_type"),"U");
	String page_id		= StringUtil.nvl(request.getParameter("page_id"));


	HashMap infos = new HashMap();
	infos.put("page_id", page_id);

	HomePageDAO dao 	= new HomePageDAO();
	HashList list 	= dao.selectPageList(infos);



%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="/SE2.3.1.O9858/js/HuskyEZCreator.js" charset="utf-8"></script>

	<script type="text/javascript">
	var oEditors = [];

	$(document).ready(function() {

		cfInitSE("page_content");



	});


	function fnSave() {
		if (confirm(MSG_<%=job_type%>)) {
			oEditors.getById["page_content"].exec("UPDATE_CONTENTS_FIELD", []);
			$('#saveForm').attr('action', './pageSave.do');
			$('#saveForm').submit();
		}
	}


	function fnDelete() {
		if (confirm(MSG_D)) {
			$('#job_type').val('D');
			$('#saveForm').attr('action', './pageSave.do');
			$('#saveForm').submit();
		}
	}

	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>페이지관리</h1>
				<p>관리자 > 홈페이지관리 > <b>페이지관리</b></p>
			</div>
			<div class="clear line_01"></div>

			<ul id="tabs" class="tab_01 mt15">
			    <li class="on"  code="1"><p>1. 기본사항</p></li>
			</ul>

			<div id="tabs-1" class="mt15">

				<form id="saveForm" method="post" action="" enctype="multipart/form-data">
				<input type="hidden" name="job_type" id="job_type" value="<%= job_type %>"/>
				<input type="hidden" name="page_id" value="<%= list.get("page_id", 0) %>"/>

				<table cellpadding="0" cellspacing="0" class="table_01 mt5">
				<colgroup>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<tr>
						<th><p>페이지명</p></th>
						<td class="brx">
		        			<input type="text" name="page_title" id="page_title" class="wmax" value="<%= list.get("page_title", 0) %>" />
						</td>
					</tr>
					<tr>
						<th><p>페이지내용</p></th>
						<td class="brx">
							<textarea name="page_content" id="page_content" style="width:880px; height:600px"><%= list.get("page_content", 0) %></textarea>
						</td>
					</tr>
				</tbody>
				</table>

				<div class="mt20 mb10 c">
					<a href="./pageList.jsp"><img src="/images/admin/btn_list.gif"/></a>
			<%	if ("U".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="/images/admin/btn_update.gif" /></a>
					<a href="#nohref" onclick="fnDelete()"><img src="/images/admin/btn_delete.gif" /></a>
			<%	} else if ("C".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="/images/admin/btn_register.gif" /></a>
			<%	} %>
				</div>

				</form>

			</div>






		</div>
	</div>
</div>

</body>
</html>
